package com.zhang.teachingcommunity_spring.controller;

import com.zhang.teachingcommunity_spring.mapper.entity.School;
import com.zhang.teachingcommunity_spring.service.SchoolService;
import com.zhang.teachingcommunity_spring.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/school")
public class SchoolController {
    @Autowired
    private SchoolService schoolService;
    @GetMapping("/findAll")
   public Result getSchools() {
        List<School> school = schoolService.getSchools();
        return Result.success("获取数据成功!",school);
    }
}
